import { BasicPageParams, BasicFetchResult } from '@/api/model/baseModel';

export interface loginAuthItem {
  admin: {};
  menu: {}[];
}

export type AccountParams = BasicPageParams & {
  account?: string;
  nickname?: string;
  id?: string;
};

export type SubAccountParams = {
  job?: string;
  part?: string;
  password?: string;
  role?: number | string;
  control_num?: number | string;
  expiration?: number | string;
  realname?: string;
  username?: string;
  id?: string;
  type?: string; // status
  status?: number;
};

export interface AccountListItem {
  id: number;
  job: string;
  loginip: string;
  logintime: string;
  part: string;
  role: number;
  rolename: string;
  status: number;
  realname: string;
  username: string;
}

export interface AuthRoleListItem {
  id: number;
  is_edit: boolean;
  num: number;
  operator: string;
  role: string;
  status: number;
  update_time: string;
}

export type AccountRoutes = {
  id: number;
  type: string;
  url: string;
  model: boolean;
  name: string;
  indeterminate?: boolean;
  level?: number;
  title?: string;
  method?: string;
  parent_id?: number;
  children: AccountRoutes[];
};

export interface AccountAuthListItem {
  role: string;
  status: number;
  routes: AccountRoutes[];
}

export interface LogParams {
  operator_name?: string;
  module_id?: string;
  menu_id?: string;
  types?: string;
  start_time?: string;
  end_time?: string;
}

/**
 * @description: Get menu return value
 */
export type loginAuth = loginAuthItem;

export type AccountListGetResultModel = BasicFetchResult<AccountListItem>;

export type AuthRoleListGetResultModel = BasicFetchResult<AuthRoleListItem>;

export type AccountAuthListGetResultModel = BasicFetchResult<AccountAuthListItem>;
